[IA64] Declarations for PKR
authorAlex Williamson <alex.williamson@hp.com>
Mon, 30 Jul 2007 22:07:11 +0000 (16:07 -0600)
committerAlex Williamson <alex.williamson@hp.com>
Mon, 30 Jul 2007 22:07:11 +0000 (16:07 -0600)
Added new declarations for protection keys and define
XEN_IA64_NPKRS representing number of PKRs for PV domains.

Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
xen/arch/ia64/xen/fw_emul.c
xen/include/asm-ia64/xenkregs.h
xen/include/asm-ia64/xenprocessor.h

index 12eabeb44d6e7e3dcfa314e8f301b0391c856452..4b250017507c42aeac77e9a873dad74e2d8fff39 100644 (file)
@@ -669,7 +669,7 @@ xen_pal_emulator(unsigned long index, u64 in1, u64 in2, u64 in3)
                                 { .vw = 1,
                                   .phys_add_size = 44,
                                   .key_size = 16,
-                                  .max_pkr = 15,
+                                  .max_pkr = XEN_IA64_NPKRS,
                                   .hash_tag_id = 0x30,
                                   .max_dtr_entry = NDTRS - 1,
                                   .max_itr_entry = NITRS - 1,
index 1953de858f5503bdf6d49a44fe026288df8ca96a..c269c84dd33c878806fbb193d6d6eb78b3539b86 100644 (file)
 /* Some cr.itir declarations. */
 #define        IA64_ITIR_PS            2
 #define        IA64_ITIR_PS_LEN        6
-#define IA64_ITIR_PS_MASK      (((__IA64_UL(1) << IA64_ITIR_PS_LEN) - 1) \
-                                                       << IA64_ITIR_PS)
+#define        IA64_ITIR_PS_MASK       (((__IA64_UL(1) << IA64_ITIR_PS_LEN) - 1) \
+                                                       << IA64_ITIR_PS)
 #define        IA64_ITIR_KEY           8
 #define        IA64_ITIR_KEY_LEN       24
 #define        IA64_ITIR_KEY_MASK      (((__IA64_UL(1) << IA64_ITIR_KEY_LEN) - 1) \
                                                        << IA64_ITIR_KEY)
-#define IA64_ITIR_PS_KEY(_ps, _key)    (((_ps) << IA64_ITIR_PS) | \
-                                       (((_key) << IA64_ITIR_KEY)))
+#define        IA64_ITIR_PS_KEY(_ps, _key)     (((_ps) << IA64_ITIR_PS) | \
+                                        (((_key) << IA64_ITIR_KEY)))
+
+/* Define Protection Key Register (PKR) */
+#define        IA64_PKR_V              0
+#define        IA64_PKR_WD             1
+#define        IA64_PKR_RD             2
+#define        IA64_PKR_XD             3
+#define        IA64_PKR_MBZ0           4
+#define        IA64_PKR_KEY            8
+#define        IA64_PKR_KEY_LEN        24
+#define        IA64_PKR_MBZ1           32
+
+#define        IA64_PKR_VALID          (1 << IA64_PKR_V)
+#define        IA64_PKR_KEY_MASK       (((__IA64_UL(1) << IA64_PKR_KEY_LEN) - 1) \
+                                                       << IA64_PKR_KEY)
+
+#define        XEN_IA64_NPKRS          15      /* Number of pkr's in PV */
 
 #endif /* _ASM_IA64_XENKREGS_H */
index 7a38f1bc8c3d3a7dae58f833d9fd5e690eae0caa..6dce305b9d6fc0ac4cf0947299d1e97c9f78f91a 100644 (file)
@@ -237,6 +237,19 @@ typedef union {
     u64 itir;
 } ia64_itir_t;
 
+typedef union {
+       u64 val;
+       struct {
+               u64 v  : 1;
+               u64 wd : 1;
+               u64 rd : 1;
+               u64 xd : 1;
+               u64 reserved1 : 4;
+               u64 key : 24;
+               u64 reserved2 : 32;
+       };
+} ia64_pkr_t;
+
 #define dump_execution_state() printk("FIXME: implement ia64 dump_execution_state()\n");
 
 #endif // _ASM_IA64_XENPROCESSOR_H